package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

/**
 * Created by Administrator on 2017/10/19.
 */
public enum SEQ_TYPE implements NamedEnumEntity<Integer> {
	BIG(10, "大序号"), SMALL(20, "小序号");
	private Integer value;

	private String name;

	SEQ_TYPE(Integer value, String name) {
		this.name = name;
		this.value = value;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public Integer getValue() {
		return value;
	}

	public static SEQ_TYPE fromValue(Integer id) {
		switch (id) {
		case 10:
			return BIG;
		case 20:
			return SMALL;
		default:
			throw new IllegalArgumentException("Value [" + id + "] not support!");
		}
	}
}
